# -*- coding: utf-8 -*-



import  wx
import  os
import sys

#import logtextctrl as logtc

try:
    from features.UI.common import constants
    from features.UI.common import windict
except:
    from UI.common import constants
    from UI.common import windict

from features.UI.common import constants

class BaseView(wx.Window):
    def __init__(self,parent):
        wx.Window.__init__(self, parent, -1, style = wx.SIMPLE_BORDER)
        self.Bind(wx.EVT_SIZE, self.OnReSize)
        self.wdict = windict.WinDict()

    def OnReSize(self, evt):
        clist =  self.GetChildren()
        for one in clist:
            one.SetSize(evt.GetSize())
        self.SetSize(evt.GetSize())
        evt.Skip()
        
        
    def setDict(self,key,value):
        self.wdict.set(key,value)
        
        
    def getDict(self,key):
        try:
            return self.wdict.get(key)        
        except:
            return None
        